﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Game
{
    public abstract class VisibleGameObject
    {
        public MySprite[] _Sprite;
        public int _nSprite;
        private float _x;

        public float X
        {
            get { return _x; }
            set { 
                _x = value;
                for (int i = 0; i < _nSprite; i++)
                {
                    _Sprite[i].x = _x;
                }
            }
        }
        private float _y;

        public float Y
        {
            get { return _y; }
            set { 
                _y = value;
                for (int i = 0; i < _nSprite; i++)
                {
                    _Sprite[i].y = _y;
                }
            }
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            int i;
            for (i = 0; i < _nSprite; i++)
                _Sprite[i].Draw(gameTime, spriteBatch);
        }

        public void Update(GameTime gameTime)
        {
            int i;
            for (i = 0; i < _nSprite; i++)
                _Sprite[i].Update(gameTime);
        }
    }
}
